package com.simple.chinagpay.controller;

import com.simple.chinagpay.service.CallbackService;
import com.simple.common.entity.ResData;
import com.simple.common.entity.controller.CallbackDynamicAction;
import com.simple.common.entity.dto.pay.CallbackDynamicDto;
import com.simple.common.entity.dto.pay.CallbackRspDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yasud
 * @date 2021年03月10日 15:17
 * @description
 */
@RestController
public class CallbackController implements CallbackDynamicAction {

    @Autowired
    CallbackService callbackService;

    @Override
    public ResData callbackDynamic(CallbackDynamicDto callbackDto) throws Exception {
        CallbackRspDto rspDto = callbackService.callback(callbackDto);
        return ResData.ok(rspDto);
    }
}
